//-----------------------------------------------------------------------------
//  Copyright (C) 2005-2008 Thomas S. Ullrich 
//
//  This file is part of the Solitaire Mahjong project.
//
//  This file may be used under the terms of the GNU General Public License.
//  This project is free software; you can redistribute it and/or modify it
//  under the terms of the GNU General Public License.
//  
//  Author: Thomas S. Ullrich
//  Last update: June 1, 2007
//-----------------------------------------------------------------------------
#ifndef smHighscoreList_h
#define smHighscoreList_h

#include <QPixmap> 
#include <vector>
#include "smHighscoreEntry.h"
#include "ui_smHighscoreList.h"

using namespace std;
 
class QSettings;
 
class smHighscoreList : public QDialog
{
    Q_OBJECT
    

public:
    smHighscoreList(QWidget* parent = 0, Qt::WindowFlags fl = 0);
    ~smHighscoreList();
 
    bool insertEntry(smHighscoreEntry&);
    void print(ostream&);
    void load(QSettings*);
    void save(QSettings*);
    void syncAndShow();
 
public slots:
    void clear();
 
protected:
    void sync();
    unsigned int checksum() const;
    void showEvent(QShowEvent*);
    void hideEvent(QHideEvent*);
    
private:
    Ui::smHighscoreList      ui;
    vector<smHighscoreEntry> mList;
    smHighscoreEntry         mLastEntry;
};
#endif
